import * as THREE from 'three'
/*
* 添加灯光 加载环境贴图
* */
export  const addLight = (scene,renderer) => {
  const directionalLight1 = new THREE.DirectionalLight('#ffffff', 2)
  const directionalLight2 = new THREE.DirectionalLight('#ffffff', 1)
  const directionalLight3 = new THREE.DirectionalLight('#ffffff', 1)
  const directionalLight4 = new THREE.DirectionalLight('#ffffff', 1)
  directionalLight1.position.set(70, 50, 0)
  directionalLight2.position.set(-70, 50, 0)
  directionalLight3.position.set(0, 50, 30)
  directionalLight4.position.set(0, 50, -30)
  // 添加阴影
  directionalLight1.castShadow = true
  directionalLight2.castShadow = true
  directionalLight3.castShadow = true
  directionalLight4.castShadow = true
  // 设置阴影的模糊程度
  directionalLight1.shadow.blurSamples = 10
  directionalLight2.shadow.blurSamples = 10
  directionalLight3.shadow.blurSamples = 10
  directionalLight4.shadow.blurSamples = 10

  scene.add(directionalLight1)
  scene.add(directionalLight2)
  scene.add(directionalLight3)
  scene.add(directionalLight4)
  const ambientLight = new THREE.AmbientLight('#F5F5F5', 1)
  scene.add(ambientLight)
};
export const renderControls = (controls)=>{
  controls.update();
}

